package com.coffee.log.dispose;

import com.coffee.log.capture.OperationLogBO;
import com.coffee.mybatis.CoffeeDynamicTableNameContextHolder;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @author songkui
 * @since 2025/4/28
 */
@Service
@AllArgsConstructor
@Slf4j
public class OperationLogService {

    private final OperationRepository operationRepository;

    public void save(OperationLogBO bo) {
        CoffeeDynamicTableNameContextHolder.setTableName(bo.getTablePos());
        operationRepository.save(OperationLongConvert.entityToVO(bo));
    }
}
